export default class ScorePanel {
  score: number = 0;
  level: number = 1;
  scoreElement: HTMLElement;
  levelElement: HTMLElement;
  maxLevel: number = 10;
  levelStep: number = 10;
  constructor() {
    this.scoreElement = document.getElementById("score")!;
    this.levelElement = document.getElementById("level")!;
    for (let i = 0; i < 100; i++) {
      this.addScore();
    }
  }
  addScore() {
    this.score++;
    this.scoreElement.innerHTML = this.score + "";
    this.addLevel()
  }
  addLevel() {
    if ((this.score % this.levelStep === 0) && this.level < 10) {
      this.level++;
      this.levelElement.innerHTML = this.level + "";
    }
  }
}
